Skip to main content

mouseText

Type

function

Summary

Returns the word or text group under the mouse pointer.

Syntax

the mouseText
mouseText()

Description

Use the mouseText function within a handler to determine which word or text group the mouse pointer is hovering over, in order to take some action based on the click.

The mouseText function only returns words in a field. If the mouse pointer is not over a field, the mouseText function returns empty.

The return value contains the word the mouse pointer is over. If the textStyle of the text is "link", the return value contains the entire text group.

To get the location of the word or text group clicked, use the mouseChunk function.

Important

Words are defined a little differently by the mouseText function than the way they are used in chunk expressions. A word, for purposes of the mouseText, is any text delimited by spaces, tabs, returns, or punctuation. If the mouse pointer is over a punctuation character, only that character is returned.

Examples

the mouseText
if the style of the mouseText is "group" then showDef the mouseText

control structure: function

function: clickText, mouseCharChunk

glossary: handler, grouped text, mouse pointer, return, chunk expression, return value

keyword: character, words, word, field

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?